// recursion to do x multiply y times, recursion to do 1+2+...+100
public class Q6 {
	static public int result(int x, int y) {
		if (y > 0) {
			return result(x, --y) * x;
		} else
			return 1;
	}

	static public int plus(int m, int n) {
		if (m < n) {
			return plus(m + 1, n) + m;
		}
		if (m == n) {
			return m;
		}
		if (m > n) {
			return plus(n, m);
		}
		return -1;
	}

	public static void main(String[] args) {
		System.out.println(result(3, 2));
		System.out.println(plus(1, 100));
		System.out.println(plus(8, 8));
		System.out.println(plus(5, 1));
	}
}
